
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v = "urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>	 
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width" />
    <title>map</title>
    <script type="text/javascript" charset="gb2312" src="http://10.106.129.25:9080/PGIS_S_TileMap/js/EzMapAPI.js"></script>
    <!--����style���ô��ǰ������ռ�"v"��ϵͳԤ�������ΪVML����-->
    <style>
      v\:* {
        BEHAVIOR: url(#default#VML)
      }
      #contentArea,#offscreenArea{
        left: 10vh!important;
        top: 30vh!important;
      }
      
      #tooltip-wrap{
        background-color: rgba(48, 47, 47, 0.6) !important;
        border-radius: 4px;
        padding: 15px;
        color: #fff;
      }

    </style>
    <script type="text/javascript">
      var _MapApp;
      var _markerFirst
      function onLoad(){
        _MapApp = new EzMap(document.getElementById("mymap"));
        _MapApp.showMapControl();
        // console.log(_MapApp.getCenterLatLng())
        _MapApp.centerAndZoom(_MapApp.getCenterLatLng(), 8);
        //移动至中心
        // _MapApp.gotoCenter()
        // console.log(JSON.stringify(item))
          // let jsonStr = '{"latestLat":"44.9419","latestLng":"125.3919","latestLocation":"","latestLocationTime":" ","victimPhone":"16643256433"}'
          // setMarker(jsonStr)
      }
      function setMarker(str) {
        let obj=JSON.parse(str)
        // console.log(obj)
         _MapApp.clearOverlays()
        var pIcon=new Icon();// 构造一个图标类
          pIcon.image="./img/marker_red.png";
          pIcon.width=25;
          pIcon.height=35;
        // 创建Marker标注，使用图标
        if (obj.latestLng != 0 && obj.latestLat != 0) {
          // console.log(item.latestLng,item.latestLat)
          var pt = new Point(obj.latestLng, obj.latestLat)
          var marker = new Marker(pt,pIcon);// 构造一个标记叠加对象
          _MapApp.addOverlay(marker);// 将标记叠加对象添加到地图中
          _MapApp.recenterOrPanToLatLng(pt) //地图对中移动到打点位置
        }else{
          _MapApp.gotoCenter()
        }
    }
    </script>
  </head> 
  <body onload="onLoad()">
    <div id="mymap" class="map"></div>
  </body>
</html>

